#ifndef BUFFER_H
#define BUFFER_H

#include <iostream>
#include "List.h"
#include "RecordBuffer.h"

#define RES_OK 0
#define RES_ERROR -1

// Defino un tamaño maximo de buffer de 5 mb
#define BUFFER_MAX_SIZE 5242880

// Defino el tamaño del vector de listas usando un nro. primo
#define LINKED_MAX 113

class Buffer
{
	private:
		// Attributes
		List *vList[LINKED_MAX];
		unsigned int size;

		// private Method
		int hashFunction(int handler, int offset);
		
		// Constructor 
		Buffer();
		

		// Static Attribute
		//static Buffer* instance;
	public:
		// Destructor
		
		~Buffer();

		// Static Methods
		static Buffer* GetInstance();

		// Methods
		int get(int handler, int offset, void* ptr, unsigned int &size);
		void add(int handler, int offset, void* ptr, unsigned int size);

};


#endif



